package org.tloss.games.mummy;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;

public class DataReader {
	String data;
	int index;

	public void parse(String resouce) {
		FileHandle file = Gdx.files.internal(resouce);
		data = file.readString();
		index = 0;
	}

	public boolean haveNext() {
		return index < data.length();
	}

	public String get() {
		if (!haveNext())
			return null;
		String size = data.substring(index, index + 3);
		int iSize = Integer.parseInt(size);
		index = index + 3;
		String rs = data.substring(index, index + iSize);
		index = index + iSize;
		return rs;

	}
}
